package cn.cloud.all.security.oauth2.provider.token.store;

import cn.cloud.all.security.oauth2.common.exceptions.InvalidTokenException;

import java.util.Map;

/**
 * This interface provides the capability of verifying the claim(s)
 * contained in a JWT Claims Set, for example, expiration time (exp),
 * not before (nbf), issuer (iss), audience (aud), subject (sub), etc.
 */
public interface JwtClaimsSetVerifier {

    /**
     * Verify the claim(s) in the JWT Claims Set.
     *
     * @param claims the JWT Claims Set
     * @throws InvalidTokenException if at least one claim failed verification
     */
    void verify(Map<String, Object> claims) throws InvalidTokenException;

}